<table class="box-vang5" cellpadding="0" cellspacing="0" width="100%">
        <tbody><tr class="light">
          <td class="text-top">.:. Chiến dịch Marketing</td>
        </tr>
      </tbody></table>
      <table class="box-vang5" cellpadding="0" cellspacing="0" width="100%">
        <tbody><tr class="light">
          <td class="t-l"></td>
          <td class="t-c"></td>
          <td class="t-r"></td>
        </tr>
        <tr class="light">
          <td class="c-l"></td>
          <td class="c-c" valign="top">
         
<div id="noidung-tab1">
	<form method="post" action="">
     <p>Ngày bắt đầu<span>
   <input type="text" name="txtNgaybatdau" style="width:100px;" id="txtNgaybatdau"/>
                       		<script type="text/javascript">
							$(function()
							{
								var arrayDayName=["CN","Hai","Ba","Tư","Năm","Sáu","Bảy"];
								var arrayMonthName=["Tháng 1","Tháng 2","Tháng 3","Tháng 4","Tháng 5","Tháng 6","Tháng 7","Tháng 8","Tháng 9","Tháng 10","Tháng 11","Tháng 12"];
								
								$('#txtNgaybatdau').datepicker({
									yearRange: 'c-12:c+8',
									changeMonth: true,
									changeYear: true,
									dateFormat: 'dd-mm-yy',
									showAnim: 'slideDown',
									monthNamesShort:arrayMonthName,
									dayNamesMin:arrayDayName
								});										
							});	
						</script>
    </span> 
    <span>Ngày kết thúc</span> 
    <span> 
    	 <input type="text" name="txtNgaykethuc" style="width:100px;" id="txtNgaykethuc"/>
                       		<script type="text/javascript">
							$(function()
							{
								var arrayDayName=["CN","Hai","Ba","Tư","Năm","Sáu","Bảy"];
								var arrayMonthName=["Tháng 1","Tháng 2","Tháng 3","Tháng 4","Tháng 5","Tháng 6","Tháng 7","Tháng 8","Tháng 9","Tháng 10","Tháng 11","Tháng 12"];
								
								$('#txtNgaykethuc').datepicker({
									yearRange: 'c-12:c+8',
									changeMonth: true,
									changeYear: true,
									dateFormat: 'dd-mm-yy',
									showAnim: 'slideDown',
									monthNamesShort:arrayMonthName,
									dayNamesMin:arrayDayName
								});										
							});	
						</script>
    </span> 
    <?php if($_SESSION['level']==2 or $_SESSION['level']==3){?>

    
    &nbsp;&nbsp;
    <span>Tìm theo từ khóa</span> 
    <span> 
    	<input type="text" style="width:200px;" />
    </span> 
    <?php }?>
   
   
        &nbsp;
    <span><input name="button" type="submit" value="Tìm kiếm" class="cs-title-timkiem"/></span>
    &nbsp;&nbsp; 
    	
    </p>
    
    </form>
    <div class="clear" style="height:10px"></div>

<? 	$trangthai = $_GET['tt'];	
	$IDman = $_SESSION['userid'];
	$sqlstring="select * from tb_marketing";
	if($trangthai!=""){$sqlstring.=" where marketing_trangthai = '$trangthai'  order by IDmarketing desc";}
	if($search!=""){$sqlstring.="  and (Maso like '%$search%' or Tenchiendich like '%$search%' or Ngansach like '%$search%' )";}
	$qr12=mysql_query($sqlstring);
	$n_record=mysql_num_rows($qr12); 
	$p=$_SESSION['page'];
	$n=$_GET['n'];
	

	//if ($n!='all'){	$sqlstring.=" limit $s,$p";	 }
	$qr1=mysql_query($sqlstring); 
	$i=0;
	
	//$date=date("Y-m-d H:i:s"); ;
	//mysql_query("update tbtaikhoan set taikhoan_ngay= '$date' where taikhoan_id='$ids'");
  ?>
<table id="box-quick" class="box-quick" border="0" cellpadding="5" cellspacing="0" width="100%">
          <tbody><tr id="title">
            <td width="5%">STT</td>
            <td width="40%">Tên chiến dịch</td>
            <td width="10%">Mã chiến dịch</td>
            <td width="12%">Trạng thái</td>            
            <td width="8%">Ngày bắt đầu</td>
            <td width="8%">Ngày kết thúc</td>
            <td width="5%">Thao tác</td>
          </tr>
         <?php 
		 	while($row=mysql_fetch_array($qr1)) 
			{
				$i=$i+1;
				$ids=$row['IDmarketing'];				
		 ?>
           <tr class="light" id="value" style="cursor:pointer;" onmouseover="mouse_den(this)" onmouseout="mouse_di(this)" bgcolor="">
            <td style="border-left:1px solid #ccc"><div align="center"><?=$i?></div></td>
          
            <td  class="tdbg_2"><div align="left">&nbsp;<span title="">
				<a href="index.php?tn=marketing&ma=marketing_detail&id=<?php echo $ids;?>">
				<?php 
				$trangthai = $row['marketing_trangthai'];
				if($trangthai==5){
				?><font color="#CCCCCC"><b><?=$row['Tenchiendich']?></b></font>
                <?php }				
				if($trangthai==1){
				?><b><?=$row['Tenchiendich']?></b>
                <?php }			
				if($trangthai==2){
				?><font color="#CC3300"><b><?=$row['Tenchiendich']?></b></font>
                <?php }			
				if($trangthai==3){
				?><font color="#009900"><b><?=$row['Tenchiendich']?></b></font>
                <?php }			
				if($trangthai==4){
				?><font color="#000000"><b><?=$row['Tenchiendich']?></b></font>                
                <?php }?>
				</a>
                 </span>
                </div>
            </td>
           
            <td align="center">     
            <?php 
				$trangthai = $row['marketing_trangthai'];
				if($trangthai==5){
				?><font color="#CCCCCC"><b><?=$row['Maso']?></b></font>
                <?php }				
				if($trangthai==1){
				?><b><?=$row['Maso']?></b>
                <?php }
				if($trangthai==2){
				?><font color="#CC3300"><b><?=$row['Maso']?></b></font>
                <?php }
				if($trangthai==3){
				?><font color="#009900"><b><?=$row['Maso']?></b></font>
                 <?php }
				if($trangthai==4){
				?><font color="#000000"><b><?=$row['Maso']?></b></font>
				<? }?>       	
				        	
            </td>
            <td align="center" >
            
            	<?php 
				$trangthai = $row['marketing_trangthai'];
				if($trangthai==1){
				?> Đang lên kế hoạch
                <?php }?>
                <?php 
				$trangthai = $row['marketing_trangthai'];
				if($trangthai==2){
				?><font color="#CC3300"><b>Sẵn sàng thực hiện</b></font>
                <?php }?>
                <?php 
				$trangthai = $row['marketing_trangthai'];
				if($trangthai==3){
				?><font color="#009900"><b>Đang thực hiện</b></font>
                <?php }?>
                 <?php 
				$trangthai = $row['marketing_trangthai'];
				if($trangthai==4){
				?><font color="#000000"><b>Chiến dịch hoàn thành</b></font>
                <?php }?>
                 <?php 
				$trangthai = $row['marketing_trangthai'];
				if($trangthai==5){
				?><font color="#CCCCCC"><b>Chiến dịch hủy</b></font>
                <?php }?>
            </td>
            <td align="center"> 12/12/2012 </td>
             <td>30/12/2012</td>
              
             <td align="center">
             
             	
			<a onmouseout="menuLayers.hide();" onclick="menuLayers.show('<?php echo $ids;?>_action_kh', event); "><img width="16" align="absmiddle" src="http://tamnguyen.gencrm.com//images/Thao_Tac_list.png"></a>&nbsp;
                            
             </td>
          </tr>
          
          
        </tbody>
                                                        
  <div id="<?php echo $ids;?>_action_kh" class="layermask" style="left: 1008px; top: 112px; visibility: hidden;">
	<ul>	
     <li onclick="window.location='index.php?tn=marketing&ma=edit&id=<?php echo $ids;?>';" style="cursor:pointer;"><img src="../skins/images/edit.png" style="float: left"> <p>Sửa</p>
        </li>
       <li onclick="if(confirm('Bạn muốn xóa chiến dịch này không?')){window.location='index.php?tn=marketing&ma=del&id=<?php echo $ids;?>';}" style="cursor:pointer;">
        <img src="../skins/images/del.png" style="float: left"> <p>Xóa</p>
        </li>  
</ul>	
</div>
<?php }?>

        </table>
        
 <td class="c-r"></td>
        </tr>
        <tr class="light">
          <td class="b-l"></td>
          <td class="b-c"></td>
          <td class="b-r"></td>
        </tr>
      </tbody></table>
 